import 'package:flutter/material.dart';

final lightColors = _Colors(
  textPrimary: const Color(0XFF323232),
  textSecondary: const Color(0xFF303030),
  inverTextPrimary: const Color(0xFFFFFFFF),
  borderColor: const Color(0XFFD9D9D9),
);

final darkColors = _Colors(
  textPrimary: const Color(0xFFFFFFFF),
  textSecondary: const Color(0XFFF2F2F2),
  inverTextPrimary: const Color(0xFFFFFFFF),
  borderColor: const Color(0xFF262626),
);

const ColorScheme lightColorScheme = ColorScheme(
  brightness: Brightness.light,
  primary: Color(0xFF806CFF),
  onPrimary: Colors.white,
  secondary: Colors.black,
  onSecondary: Colors.black,
  error: Color(0xFFF53F3F),
  onError: Colors.white,
  surface: Color(0xFF151618),
  onSurface: Colors.white,
);

const ColorScheme darkColorScheme = ColorScheme(
  brightness: Brightness.dark,
  primary: Color(0xFF806CFF),
  onPrimary: Colors.white,
  secondary: Colors.black,
  onSecondary: Colors.black,
  error: Color(0xFFF53F3F),
  onError: Colors.white,
  surface: Color(0xFF151618),
  onSurface: Colors.white,
);

class Colorsvariable {
  // #region 圆角大小
  static BorderRadius radiusSmall = BorderRadius.circular(4.0);

  static BorderRadius radiusMedium = BorderRadius.circular(8.0);

  static BorderRadius radiusLarge = BorderRadius.circular(16.0);
  // #endregion 圆角大小

  // #region 大小
  static double large = 16.0;
  static double middle = 8.0;
  static double small = 4.0;
  // #endregion 大小

  // #region 操作颜色
  static Color hoverColor = Colors.white.withOpacity(0.0605);
  static Color activeColor = Colors.white.withOpacity(0.0319);

  // ignore: library_private_types_in_public_api
  static _VariableColors getColorScheme(Brightness brightness) {
    ColorScheme colorScheme =
        brightness == Brightness.dark ? darkColorScheme : lightColorScheme;
    _Colors colors = brightness == Brightness.dark ? darkColors : lightColors;
    return _VariableColors(colorScheme: colorScheme, colors: colors);
  }
  // #endregion
}

class _VariableColors {
  _VariableColors({
    required this.colorScheme,
    required this.colors,
  });

  final ColorScheme colorScheme;
  final _Colors colors;
}

class _Colors {
  _Colors({
    required this.textPrimary,
    required this.inverTextPrimary,
    required this.textSecondary,
    required this.borderColor,
  });

  final Color textPrimary;
  final Color inverTextPrimary;
  final Color textSecondary;
  final Color borderColor;
}
